from pyim.user import User


def authenticate(username, password):
    return User.manager.get_user(username)

    # response = requests.request("post",
    #                             config.system_config[
    #                                 "api_url"] + "/im/auth_user_pass/?username=%s&password=%s" % (
    #                                 username, password))
    #
    # try:
    #     data = json.loads(response.text)
    # except Exception as _:
    #     return None
    # else:
    #     if "errcode" in data and data["errcode"] != 0:
    #         return None
    #     else:
    #         return User(username)
